import 'package:flutter/material.dart';
import 'package:flutter_question_app/constants.dart';
import 'package:flutter_question_app/screens/quiz/quiz_screen.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart';

class WelcomeScreen extends StatelessWidget {
  const WelcomeScreen({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        fit: StackFit.expand,
        children: [
          SvgPicture.asset("assets/icons/bg.svg", fit: BoxFit.fill),
          SafeArea(
            child: Padding(
              padding: const EdgeInsets.symmetric(horizontal: kDefaultPadding),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Spacer(flex: 2),
                  Text(
                    "Let's Play Quiz,",
                    style: Theme.of(context).textTheme.headline4.copyWith(
                          color: Colors.white,
                          fontWeight: FontWeight.bold,
                        ),
                  ),
                  Text("Enter your informations below"),
                  Spacer(), //
                  TextField(
                    decoration: InputDecoration(
                      hintText: "Full Name",
                      filled: true,
                      fillColor: Color(0xff1c2341),
                      border: OutlineInputBorder(
                        borderRadius: BorderRadius.all(
                          Radius.circular(12),
                        ),
                      ),
                    ),
                  ),
                  Spacer(), //
                  Container(
                    width: double.infinity,
                    // padding: EdgeInsets.all(kDefaultPadding * 0.75),
                    decoration: BoxDecoration(
                      gradient: kPrimaryGradient,
                      borderRadius: BorderRadius.all(
                        Radius.circular(12),
                      ),
                    ),
                    child: TextButton(
                      child: Padding(
                        padding: EdgeInsets.all(kDefaultPadding * 0.75),
                        child: Text(
                          "Lets Start Quiz",
                          style: Theme.of(context).textTheme.button.copyWith(
                              // color: Colors.black,
                              ),
                        ),
                      ),
                      onPressed: () {
                        Get.to(() => QuizScreen());
                      },
                    ),
                  ),
                  Spacer(flex: 2),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
